package com.iespring.controller.app.address;

import com.github.pagehelper.PageHelper;
import com.iespring.bean.app.address.bo.AddressBo;
import com.iespring.bean.common.BaseRespVo;
import com.iespring.bean.common.CommonData;
import com.iespring.service.app.address.AddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author weigwen
 * @Description:
 * @Date 2022/12/31 17:15
 */

@RestController
@RequestMapping("wx")
public class AddressController {

    @Autowired
    AddressService addressService;

    @RequestMapping("address/list")
    public BaseRespVo addressList(){

        CommonData commonData = addressService.addressList();
        return BaseRespVo.ok(commonData);
    }

    @RequestMapping("address/detail")
    public BaseRespVo addressDetail(AddressBo addressBo){
        BaseRespVo baseRespVo = addressService.addressDetail(addressBo);
        return baseRespVo;
    }

    @PostMapping("address/save")
    public BaseRespVo addressSave(@RequestBody AddressBo addressBo){
        BaseRespVo baseRespVo = addressService.addressSave(addressBo);
        return baseRespVo;
    }

    @PostMapping("address/delete")
    public BaseRespVo addressDelete(@RequestBody AddressBo addressBo){
        BaseRespVo baseRespVo = addressService.addressDelete(addressBo);
        return baseRespVo;
    }

}
